from django.shortcuts import render
from django.http import HttpResponseRedirect

from qiniu import Auth
from qiniustorage.backends import  QINIU_ACCESS_KEY,QINIU_SECRET_KEY
from django.contrib.auth.decorators import login_required
@login_required()
def report_download(request):
    """download report"""
    url=request.GET.get("url")
    auth=Auth(QINIU_ACCESS_KEY,QINIU_SECRET_KEY)
    download_url=auth.private_download_url(url)
    return HttpResponseRedirect(download_url)
